<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	// 获得本项目的地址(例如: http://localhost:8080/MyApp/)赋值给basePath
	//变量 
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	// 将 "项目路径basePath" 放入pageContext中，待以后用EL表达式读出。 
	pageContext.setAttribute("basePath", basePath);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href=" <%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<script type="text/javascript">
	function btn_okClick() {

		var password = frm_register.password.value;
		var passwordone = frm_register.passwordone.value;
		var passwordtwo = frm_register.passwordtwo.value;

		if (password == "") {
			alert("密码不能为空！");
			frm_register.password.focus();//聚焦
			return false;
		}
		if (password.length < 6) {

			alert("密码不能小于6个字符，请重新输入！");
			frm_register.password.focus();//聚焦
			frm_register.password.select();//回显
			return false;

		}
		if (password.length > 18) {
			alert("密码长度不能超过18个字符，请重新输入！")
			frm_register.password.value = "";//清空
			frm_register.password.focus();//聚焦
			// 		frm_register.passwordone.select();//回显
			return false;
		}

		if (passwordone == "") {
			alert("密码不能为空！");
			frm_register.passwordone.focus();//聚焦
			return false;

		}

		if (passwordone.length < 6) {

			alert("密码不能小于6个字符，请重新输入！");
			frm_register.passwordone.focus();//聚焦
			frm_register.passwordone.select();//回显
			return false;

		}
		if (passwordone.length > 18) {
			alert("密码长度不能超过18个字符，请重新输入！")
			frm_register.passwordone.value = "";//清空
			frm_register.passwordone.focus();//聚焦
			// 		frm_register.passwordone.select();//回显
			return false;
		}

		if (passwordtwo == "") {
			alert("密码不能为空！");
			frm_register.passwordtwo.focus();//聚焦
			return false;
		}

		if (passwordone != passwordtwo) {
			alert("两次输入密码不一致，请重新输入！");
			frm_register.passwordone.value = "";//清空
			frm_register.passwordtwo.value = "";//清空
			frm_register.passwordone.focus();//聚焦
			return false;

		}

		return true;
		// 	frm_register.submit();//提交表单到服务器
	}

	function sub_button() {
		var result = btn_okClick();

		if (result != false) {

			frm_register.submit();//提交表单到服务器
		}

	}
</script>
<style>
.a1 {
	width: 400px;
	height: 30px;
	border: 1px solid black;
	border-radius: 5px;
	font-size: 20px;
}

.a2 {
	width: 20%;
	height: 40px;
	cursor: pointer;
	border-radius: 5px;
	font-size: 20px;
	border: 1px solid black;
}
</style>
<body>
<h2>修改密码</h2>
	<hr color="pink">
	<div style="margin-top: 90px;">
		<form action="modifyManagerPass" name="frm_register" method="post">
			<center>
				<table align="center" cellspace="20" cellpadding="15"
					style="border-collapse: 50px;">
					<!--   -->
					<tr>
						<td><font size="5">原密码：</font><input type="password"
							class="a1" name=password size="50" placeholder="请输入原密码"
							maxlength="18"></td>
					</tr>

					<tr>
						<td><font size="5">新密码：</font><input type="password"
							class="a1" name=passwordone size="50" placeholder="请输入新密码"
							maxlength="18"><span style="color: #F00">**6-18字母，数字**</span>
						</td>
					</tr>

					<tr>
						<td><font size="5">新密码：</font><input type="password"
							name=passwordtwo size="51" class="a1" placeholder="请输入新密码"
							maxlength="18"><span style="color: #F00">**6-18字母，数字**</span>
						</td>
					</tr>

					<tr>
						<td colspan="5"  align="center" ><font size="5"><input type="button"
								name="pass_ok" value="确认修改" class="a2" onclick="sub_button();"></font>
							<input type="reset" value="重置" class="a2"> <input
							type="button" value="返回" class="a2" onclick="goback();"></td>
					</tr>
				</table>
			</center>
		</form>
	</div>
</body>
<script>
	function goback() {
		// 	window.history.back(-1);
		// 	window.location.reload();
		window.location.href = "Login_0615/show.jsp";
	}
</script>
</html>